<template>
	<view class="btn-box">
		<button v-if="showBtnCancel" @tap.stop="onRefund(orderItemId)" 	type="default" size="mini">退款/退货</button>
		<button v-if="showDetail" @tap.stop="onShowDetail(orderItemId)" type="default" size="mini">退款详情</button>
	</view>
</template>
<script>
// ## 退款/售后订单状态
// 默认交易完成15天内可申请售后
// 订单交易完成可申请售后 退款/售后订单
// - 仅退款
//     - CLOSED(退款关闭，未审核前，买家主动取消)
//     - WAIT_SELLER_AGREE(买家已经申请退款，等待卖家同意)   默认48小时未审核则自动退款
//     - SELLER_REFUSE_BUYER(卖家拒绝退款)
//     - SUCCESS(退款成功)
// - 退款并退货
//     - CLOSED(退款关闭，未审核前，买家主动取消)
//     - WAIT_SELLER_AGREE(买家已经申请退款，等待卖家同意)         默认48小时未审核则自动确认
//     - WAIT_BUYER_RETURN_GOODS(卖家已经同意退款，等待买家退货)
//     - WAIT_SELLER_CONFIRM_GOODS(买家已经退货，等待卖家确认收货) 默认自动收货时间15天
//     - SELLER_REFUSE_BUYER(卖家拒绝退款)
//     - SUCCESS(退款成功)
export default {
	props: {
		orderItemStatus: {
			type: String,
			required: true
		},
		orderItemId: {
			type: Number,
			required: true
		}
	},
	computed: {
		showRefund: function () {
			return this.orderItemStatus === ''
		},
		showDetail: function () {
			return this.orderItemStatus !== ''
		},
	},
	methods: {
		// 申请退款
		onRefund(orderItemId) {
			console.log(orderItemId);
		},
		// 查看退款详情
		onShowDetail(orderItemId) {
			console.log(orderItemId);
		}
	}
};
</script>
<style lang="scss">
.btn-box {
		justify-content: flex-end;
		.obtn1 {
			width: 160rpx;
			height: 60rpx;
			background: rgba(238, 238, 238, 1);
			border-radius: 30rpx;
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: rgba(51, 51, 51, 1);
			margin-right: 20rpx;
			padding: 0;
		}
		.obtn2 {
			width: 160rpx;
			height: 60rpx;
			background: linear-gradient(90deg, rgba(233, 180, 97, 1), rgba(238, 204, 137, 1));
			box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
			border-radius: 30rpx;
			margin-right: 20rpx;
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: rgba(168, 112, 13, 0.9);
			padding: 0;
		}
	}
</style>
